package com.xuecheng.messagesdk.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.xuecheng.messagesdk.model.po.MqMessage;

import java.util.List;

public interface MqMessageService extends IService<MqMessage> {
    /**
     * 扫描消息记录表，获取待处理任务消息
     * @param shardIndex
     * @param shardTotal
     * @param messageType
     * @param count
     * @return
     */
    List<MqMessage> getMessageList(int shardIndex,int shardTotal,String messageType,int count);

    /**
     * 添加消息
     * @param messageType
     * @param businessKey1
     * @param businessKey2
     * @param businessKey3
     * @return
     */
    MqMessage addMessage(String messageType,String businessKey1,String businessKey2,String businessKey3);

    /**
     * 完成任务
     * @param id
     * @return
     */
    int completed(Long id);

    /**
     * 完成阶段任务
     * @param id
     * @return
     */
    int completedStageOne(Long id);
    int completedStageTwo(Long id);
    int completedStageThree(Long id);
    int completedStageFour(Long id);

    /**
     * 查询阶段状态
     * @param id
     * @return
     */
    int getStageOne(Long id);
    int getStageTwo(Long id);
    int getStageThree(Long id);
    int getStageFour(Long id);
}
